In patients with intractable Obsessive-Compulsive Disorder (OCD), ventral striatum (VS) deep brain stimulation (DBS) effectively reduces symptom severity in about 60% of cases. However, there is room for improvement in both clinical benefits and reduction of DBS-induced behavioral side effects, especially hypomania. A critical factor may be failure to adaptively adjust DBS in response to phasic changes in negatively and positively valenced states (i.e., OCD-related distress and hypomania, respectively). New generation adaptive DBS (aDBS) systems can record, stimulate and use signals from the brain to make responsive adjustments to the patient's behavioral state. Specific Aim 1 is to train the device to accurately classify acute fluctuations in OCD- related distress and emergence of hypomania and distinguish these states from other affective states that do not require adjustments in stimulation. Specific Aim 2 is to develop adaptive control policies that can automatically adjust stimulation parameters to regulate these undesired states. It is hypothesized that exacerbations in OCD-related distress will require increased stimulation (higher amplitude or wider pulse width) whereas hypomania will respond to decreased stimulation. These aims will be executed using a two-phase Early Feasibility Study of aDBS in 10 adults with intractable OCD. Subjects will enter a 6-month trial of open- label bilateral aDBS followed by 2 months of adjunctive cognitive behavioral therapy (CBT). Subsequently, they will enter a 4-week blinded discontinuation period to assess need for ongoing DBS. In Phase I, 5 subjects will have surgery as per procedures of the FDA Human Device Exemption (HDE) approval for VS DBS in OCD. Electrode implantation will be optimized and personalized using ?precision mapping? of each patient's anatomical connectivity from high-field tractography in native space. DBS programming sessions will also serve to train the algorithms to classify different valence states. For example, a symptom provocation paradigm will elicit different levels of manageable OCD-related distress. During this paradigm multiple streams of time- locked physiological and behavioral data will be captured to build a classifier: Local Field Potentials (LFPs) from the VS, Scalp EEG, and Automated Facial Affect Recognition (AFAR), which objectively measures emotional valence. We hypothesize that classifiers using combined LFP/EEG data will perform better than VS LFPs alone, but that direct cortical recordings will be needed for accurate classification and creation of a fully embedded, self-contained, aDBS system. In Phase II, 5 subjects will have VS DBS surgery along with bilateral subdural placement of electrocorticographic (ECoG) recording leads at a prefrontal target, informed by resting state functional MRI from Phase I and pre-operative scans. New classifiers will be built based on VS and ECoG LFPs and adaptive stimulation algorithms tested in the clinic before transfer to the ambulatory setting. Meeting all study milestones would result in a prototype ambulatory aDBS system that would manage fluctuations in OCD symptoms and device-related side effects automatically.